Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dashboard #104

Merged
merged 25 commits into from
Dec 18, 2024
Merged

Update dashboard #104

merged 25 commits into from
Dec 18, 2024

Conversation

jhoxhaa
Copy link
Collaborator

@jhoxhaa jhoxhaa commented Dec 12, 2024

No description provided.

@cla-bot cla-bot bot added the cla/signed CLA is signed by all contributors of a PR label Dec 12, 2024
@jhoxhaa jhoxhaa self-assigned this Dec 12, 2024
@jhoxhaa jhoxhaa force-pushed the update-dashboard branch 5 times, most recently from 9f1c313 to 554d298 Compare December 13, 2024 08:01
@jhoxhaa jhoxhaa changed the base branch from main to multi-cluster December 13, 2024 08:08
Base automatically changed from multi-cluster to main December 13, 2024 09:52
@jhoxhaa jhoxhaa force-pushed the update-dashboard branch 2 times, most recently from 21db026 to 0a1547d Compare December 16, 2024 11:07
@jhoxhaa jhoxhaa requested a review from lippserd December 16, 2024 11:12
@jhoxhaa jhoxhaa force-pushed the update-dashboard branch 3 times, most recently from 2b223d2 to 6aa37b4 Compare December 17, 2024 08:25
Copy link
Member

@lippserd lippserd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the changes requested, please also make cluster.name nullable in the schema.


class DashboardController extends Controller
{
public function indexAction()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add :void.

$this->addTitleTab($this->translate('Kubernetes'));

$cluster = (new ClusterForm())
->populate(['cluster_uuid' => Session::getSession()->getNamespace('kubernetes')->get('cluster_uuid')])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default in the get() call should be ClusterForm::ALL_CLUSTERS.

);
}

protected function isMultiCluster()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add :bool.

return $this->translate('Cluster management');
}

protected function assemble()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add :void.

'node',
$this->translate('Nodes'),
$this->translate(
'Out of %s total Nodes, %s are in OK state, %s are Critical, %s are in Warning state, and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use %s, but {total} and so on.

return $this->translate('Observability');
}

protected function assemble()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add :void.

return $this->translate('Storage');
}

protected function assemble()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add :void.

->columns(['uuid', 'name']);

foreach ($clusters as $cluster) {
yield (string) Uuid::fromBytes($cluster->uuid) => $cluster->name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do $cluster->name ?? $cluster->uuid here and don't do it in assemble().

@@ -138,7 +139,32 @@ public static function createList(string $kind, Rule $filter): ValidHtml
}
}

public static function createUrl(string $kind): ?Url
public static function createModel(string $kind): Model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ?Model as it may also return null.

}
}

.control-label-group {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put those rules inside .cluster-form and add the class to ClusterForm.

@lippserd lippserd merged commit 5b0888c into main Dec 18, 2024
5 checks passed
@lippserd lippserd deleted the update-dashboard branch December 18, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed CLA is signed by all contributors of a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants